package com.ocom.exposeapi.feign;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.dto.AddDeptDto;
import com.ocom.common.entity.master.EntityWechatPerInfo;
import com.ocom.common.request.human.GetDeptIdByFullNameRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PersonVo;
import com.ocom.common.vo.human.UserInfoVo;
import com.ocom.common.vo.human.UserListVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "human")
public interface HumanFeignService {

    @PostMapping(HumanServiceUrl.URL_PersonnelGetStudentInfo)
    public Result PersonnelGetStudentInfo(@Validated @RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_updateStudentByInOut)
    public Result updateStudentByInOut(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody UserInfoVo userInfoVo);

    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfoById)
    public Result PersonnelGetPersonInfoById(@Validated @RequestBody UserInfoVo userInfoVo);

    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfoByStatus)
    public Result PersonnelGetPersonInfoByStatus(@Validated @RequestBody UserInfoVo userInfoVo);

    @PostMapping(HumanServiceUrl.URL_PersonnelAddPerson)
    public Result AddPerson(@RequestBody PersonVo personVo);


    @PostMapping(HumanServiceUrl.URL_Department_GetDeptList)
    public Result getDeptList(@RequestParam("companyId") Long companyId, @RequestParam("deptId") Long deptId, @RequestParam("show") Integer show);

    //消费的用户信息
    @PostMapping(HumanServiceUrl.URL_getXfUserInfo)
    public Result getXfUserInfo(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId);


    //2.2.21 根据姓名手机号获取人员信息 getPinfoByNamePhone
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPinfoByNameAndCode)
    public Result getPinfoByNameCode(@RequestParam("companyId")Long companyId, @RequestParam("name")String name, @RequestParam("pCode")String pCode);

    @GetMapping(HumanServiceUrl.URL_Department_GetDeptInfo)
    public Result GetDeptInfo(@RequestParam("comID") Long comID,@RequestParam("deptID")  Long deptID,
                              @RequestParam("deptName")String deptName);

    @PostMapping(HumanServiceUrl.URL_getDeptIdByFullName)
    public Result getDeptIdByFullName(@RequestBody GetDeptIdByFullNameRequest request);

    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@RequestBody Map<String, Object> map);

    @PostMapping(HumanServiceUrl.URL_GetPersonnelList)
    public Result GetPersonnelList(@Validated @RequestBody UserListVo userListVo);


    @PostMapping(HumanServiceUrl.URL_Department_AddDeptInfo)
    public Result AddDeptInfo(@RequestBody AddDeptDto addDeptDto);

    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@RequestBody PersonVo personVo) ;

    @GetMapping(HumanServiceUrl.URL_GetWxPerson)
    public Result GetWxPerson(@RequestParam("appId")String appId,@RequestParam("openId")String openId,@RequestParam("comId")Long comId);

    @PostMapping(HumanServiceUrl.URLP_HUAMN_ADD_WXPER)
    public Result addWxper(@RequestBody EntityWechatPerInfo wechatPerInfo);


}
